import { dictionary } from '@/api/brand'; // 用户菜单接口

const state = {
    clientOptions: {} // 字典选项
};

const mutations = {
    SET_OPTIONS: (state, options) => {
        state.clientOptions = options;
    }
};

const actions = {
    async setOptions({ commit }) {
        const keyArr = [
            { id: '1', label: 'source' },
            { id: '2', label: 'customer_type' },
            { id: '3', label: 'fotype' },
            { id: '4', label: 'level' },
            { id: '5', label: 'distributor_type' },
            { id: '6', label: 'enterprise_type' }
        ];
        // const data = await dictionary();
        // const options = {};
        // keyArr.forEach(val => {
        //     options[val.label] = data[val.id];
        // });
        // commit('SET_OPTIONS', options);
    }
};

export default {
    namespaced: true,
    state,
    mutations,
    actions
};
